import './assets/main.css'

import { createApp } from 'vue'

// element-plus 和 el-icon 和 echarts 和 SVG
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import * as echarts from 'echarts'
import 'virtual:svg-icons-register'
import Component from './components'

import App from './App.vue'
import router from './router'
import pinia from './stores'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 使用pinia 和 element plus
app.use(ElementPlus, { locale: zhCn, })
    .use(pinia)
    .use(router)
    .use(Component)
app.config.globalProperties.$echarts = echarts;

app.mount('#app')
